<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>student question</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="<%=path%>/js/student/stuQuestion.js"></script>
  </head>
  
  <body>
  	<center>
   	<form action="askQuestion">
   		<table>
   			<tr>
   				<td><s:select label="课程" list="courseList"  headerKey="0" headerValue="-选择课程-" listKey="courseID"  listValue="courseName" name="courseID" id="select"></s:select></td>
   				
   			</tr>
   			<tr>
   				<td><s:textfield name="ansPerson" id="ansperson" label="老师：" maxlength="9"/></td>
   			</tr>
   			
   			<tr>
   				<td><s:textarea label="问题" name="quesContent" id="textarea"></s:textarea></td>
   			</tr>
   			<tr>
   				<td></td>
   				<td><input type="button"  id="buttonQ" value="提交" /></td>
   				<!-- <td><s:property value="#session.stu.stuName"/></td> -->
   				
   			</tr>
   		</table>
   	</form>
   </center>
   	<div id="questionContent">
   		
		<s:if test="questionList!=null||questionList!=''">
			<s:iterator value="questionList" status="index">
				<s:if test="askPerson==#session.stu.stuUserID">
				<hr/>
				<table border="0" style="text-align:center;">
	 			<tr>
	 				<td style="width:10%">[提问者]</td>
	 				<td style="width:55%"><s:property value="askPerson"/></td>
	 				<td style="width:15%"></td>
	 				<td style="width:20%"></td>
	 			</tr>
	 			<tr>
	 				<td style="width:10%">[问题]</td>
	 				<td style="width:55%"><s:property value="quesContent"/></td>
	 				<td style="width:15%">[留言日期]</td>
	 				<td style="width:20%"><s:property value="createTime"/></td>
	 			</tr>
	 			<tr>
	 				<td style="width:10%">【答复】</td>
	 				<td style="width:55%"><s:if test="answer==null||answer==''"><span style="color:red">未回答</span></s:if><s:else><s:property value="answer"/></s:else></td>
	 				<td style="width:15%">【回复日期】</td>
	 				<td style="width:20%"><s:property value="answerTime"/></td>
	 			</tr>
	 			</table>
	 		</s:if>
			</s:iterator>
		</s:if>
   		
   	</div>
   	
  </body>
</html>
